Skip to main content

New Password

Description

This Endpoint allows a new password to be set after the user requested a password reset. It is used on the landing page where the new password is entered. It expects the two parameters from the url.

https://thenights.app/resetpassword/' + urlsafe_base64_encode(force_bytes(user.pk)) + '/' + token

Endpoint

POST https://api.thenights.app/user_manager/newpassword

Request

Headers

KeyValue
Content-Typeapplication/json

Body

ParameterTypeRequiredDescription
uidb64Stringyesuidb64 from the reset link
tokenStringyestoken from the reset link
password1Stringyespassword field
password2Stringyesrepeat password field

Example Request Body

{
"uidb64": "Mjg4ZDRiMjItNzU2OC00ZGFkLTkwMjUtZTQ2MWZhMmZhZjYx",
"token": "bonxkf-f4b82f2b58a9b0a291f0e27c78af5507",
"password1": "hello28üä_",
"password2": "hello28üä_"
}

Response

Success Response

Code: 200 OK

ParameterTypeDescription
detailString-

Example Response Body

{
"detail": "Password updated."
}

Error Response

Code: 400 Bad Request

ParameterTypeDescription
detailString-

Example Response Body

{
"detail": "Password reset failed."
}
{
"detail": "Passwords do not match."
}

Email

After the password has been successfully reset, we send out a seccond mail to the user to inform them. This email includes the ip-adress of the client, who made the response.